package com.bysj.service;

import com.bysj.dao.CollectedGoodsDao;
import com.bysj.entity.CollectedGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CollectedGoodsServiceImpl implements CollectedGoodsService {
    @Autowired
    CollectedGoodsDao collectedGoodsDao;

    //添加被收藏的商品
    @Override
    public void addCollectGoods(CollectedGoods collectedGoods) {
        collectedGoodsDao.addCollectGoods(collectedGoods);

    }
    //获取用户所有的收藏商品
    @Override
    public List<CollectedGoods> getAllCollectGoods(Integer id) {
        return collectedGoodsDao.getAllCollectGoods(id);
    }
    //根据用户和商品id删除已收藏的商品
    @Override
    public void deleteCollectGoodsById(Integer gid, Integer uid) {
        collectedGoodsDao.deleteCollectGoodsById(gid , uid);

    }
}
